home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_cyn_strutsight.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  137 lines

  1. # Jones 3D Cog Script
  2. #
  3. # CYN_StrutSight.cog
  4. #
  5. # [CMG]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13.     message     entered
  14.  
  15.     # Actors
  16.     thing        player                            local
  17.     thing        indyActor                        nolink                
  18.  
  19.     # Actor look targets
  20.     thing        in_lktarg1                        nolink
  21.  
  22.     # Camera objects
  23.     thing        sightCam1                        nolink
  24.  
  25.     # Camera targets
  26.     thing        strt1MoveTarg                    local
  27.  
  28.     # Trigger
  29.     sector        sightsect
  30.  
  31.     # Things
  32.     thing        strut                            nolink
  33.  
  34.     # Saylines
  35.     sound        in_whipthat=inxj019.wav            local    # Hmm...that thing looks whipable
  36.     
  37.     # Keyframes
  38.     keyframe    in_hat=0in_figithat_4_4.key        local
  39.     keyframe    in_brush=0in_stand1_bd_4.key    local
  40.     keyframe    in_stand4=0in_stand4.key        local
  41.  
  42.     # Templates
  43.     template    ghostTpl=ghost                    local
  44.  
  45.     # Local variables
  46.     int            rotref                            local
  47.     int            track                            local
  48.     int            curCam                            local
  49.     int            seen                            local
  50.  
  51. end
  52.  
  53. # ========================================================================================
  54.  
  55. code
  56.  
  57. entered:
  58.  
  59. if (seen == 1) return;
  60.  
  61. if (GetSenderRef() == sightsect)
  62. {
  63.     seen = 1;
  64.     player = GetLocalPlayerThing();
  65.  
  66.     # Prep for scene...
  67.     curCam = GetCurrentCamera();
  68.     
  69.     MakeMeStop();
  70.     DeselectWeaponWait(player);
  71.     
  72.     StartCutScene(1);
  73.     SetCameraLookInterp(2, 0);
  74.     SetCameraPosInterp(2, 0);
  75.  
  76.     # Set up actor
  77.     CopyPlayerHolsters(player, indyActor);
  78.     CopyOrientAndPos(player, indyActor);
  79.     AISetCutSceneMode(indyActor);
  80.     SetThingFlags(player, 0x80000);
  81.     ClearThingFlags(indyActor, 0x80000);
  82.  
  83.     rotref=(GetThingMaxRotVel(indyActor));
  84.     SetThingMaxRotVel(indyActor, 150);
  85.     AISetLookThing(indyActor, in_lktarg1);
  86.  
  87.     # move cam to known position
  88.     SetExtCamOffsetToThing(sightCam1);
  89.  
  90.     # create target for secondary focus at player position.
  91.     strt1MoveTarg = CreateThingAtPos(ghostTpl, GetThingSector(player), GetThingPos(player), '0 0 0');
  92.  
  93.     # offset camera to thing.
  94.     SetExtCamLookOffsetToThing(strt1MoveTarg);
  95.  
  96.     # skip a beat
  97.     Sleep(1.25);
  98.  
  99.     # play indy's anims and voice line
  100.     track = PlayKey(indyActor, in_Stand4, 2, 0x0, 0);
  101.     PlayKey(indyActor, in_brush, 4, 0x12, 1);
  102.     PlayVoice(indyActor, in_whipthat, 1.0, 0);
  103.     PlayKey(indyActor, in_hat, 4, 0x12, 0);
  104.  
  105.     # switch to camera 2 with focus on ghost at indy's position
  106.     SetCameraFocus(2, sightCam1);
  107.     SetCameraSecondaryFocus(2, strt1MoveTarg);
  108.     SetCurrentCamera(2);
  109.     SetCameraFOV(90, 0, 0.0);
  110.     Sleep(0.75);
  111.  
  112.     # move camera focus object up to strut
  113.     MoveThingToPos(strt1MoveTarg, GetThingPos(strut), 2.0);
  114.     Sleep(2.75);
  115.  
  116.     # put the player at actors' position, clear actor, show player
  117.     CopyOrientAndPos(indyActor, player);
  118.     AIClearCutSceneMode(indyActor);
  119.     ClearActorFlags(player, 0x200000);
  120.     ClearThingFlags(player, 0x80000);
  121.     StopKey(indyActor, track, 0);
  122.     SetThingFlags(indyActor, 0x80000);
  123.  
  124.     # Restore the cam, end the scene
  125.     SetCameraPosition(curCam, GetThingPos(sightCam1));
  126.     SetCurrentCamera(curCam);
  127.     RestoreExtCam();
  128.     SetCameraFOV(90, 0, 0.0);
  129.     EndCutScene();
  130. }
  131.  
  132. return;
  133.  
  134. # ========================================================================================
  135. end
  136.  
  137.